Potrace: a polygon-based tracing algorithm

نویسنده

  • Peter Selinger
چکیده

Black-on-white images can be represented either as a bitmap or as a vector outline. A bitmap represents an image as a grid of black or white pixels. A vector outline describes an image via an algebraic description of its contours, typically in the form of Bezier curves. The advantage of representing an image as a vector outline is that it can be scaled to any size without loss of quality. Outline images are independent of the resolution of any particular output device. They are particularly popular in the description of fonts, which must be reproducible at many different sizes. Examples of outline font formats include PostScript Type 1 fonts, TrueType, and Metafont. On the other hand, most actual input and output devices, such as scanners, displays, and printers, ultimately produce or consume bitmaps. The process of converting a vector outline to a bitmap is called rendering. The converse process of turning bitmaps into outlines is called tracing. It is clear that no tracing algorithm can be perfect in an absolute sense, as there are in general many possible outlines that can give rise to the same bitmap. The process of tracing cannot be used to generate information that is not already present. On the other hand, out of the many possible outlines that could give rise to a given bitmap, clearly some are more plausible or aesthetically pleasing than others. For example, a common way of rendering bitmaps at a high resolution is to draw each black pixel as a precise square, which gives rise to “jaggies” or staircase patterns. Clearly, jaggies are neither pleasant to look at, nor are they particularly plausible interpretations of the original image. There is probably no absolute measure of what constitutes a good tracing algorithm, but it seems clear that some algorithms give better results than others. In this paper, we describe a tracing algorithm which is simple, efficient, and tends to produce excellent results. The algorithm is called potrace, which stands for polygon tracer. However, the output of the algorithm is not a polygon, but a smooth contour made from Bezier curves. The name of the algorithm derives from the fact that it uses polygons as an intermediate representation of images. The potrace algorithm is designed to work well on high resolution images. Thus, a typical application is to produce a vector outline from a company or university logo that has been scanned at a high resolution. Another possible application is the conversion of bitmapped fonts to outline fonts, if the original bitmapped fonts are available at a high enough resolution. No tracing algorithm will work well on very small scales, such as

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A New Heuristic Algorithm for Drawing Binary Trees within Arbitrary Polygons Based on Center of Gravity

Graphs have enormous usage in software engineering, network and electrical engineering. In fact graphs drawing is a geometrically representation of information. Among graphs, trees are concentrated because of their ability in hierarchical extension as well as processing VLSI circuit. Many algorithms have been proposed for drawing binary trees within polygons. However these algorithms generate b...

متن کامل

Algorithm for finding the largest inscribed rectangle in polygon

In many industrial and non-industrial applications, it is necessary to identify the largest inscribed rectangle in a certain shape. The problem is studied for convex and non-convex polygons. Another criterion is the direction of the rectangle: axis aligned or general. In this paper a heuristic algorithm is presented for finding the largest axis aligned inscribed rectangle in a general polygon. ...

متن کامل

A Fast Algorithm for Covering Rectangular Orthogonal Polygons with a Minimum Number of r-Stars

Introduction This paper presents an algorithm for covering orthogonal polygons with minimal number of guards. This idea examines the minimum number of guards for orthogonal simple polygons (without holes) for all scenarios and can also find a rectangular area for each guards. We consider the problem of covering orthogonal polygons with a minimum number of r-stars. In each orthogonal polygon P,...

متن کامل

Exact Illumination in Polygonal Environments using Vertex Tracing

Methods for exact computation of irradiance and form factors associated with polygonal objects have ultimately relied on a formula for a differential area to polygon form factor attributed to Lambert. This paper presents an alternative, an analytical expression based on vertex behavior rather than the edges the polygon. Using this formulation, irradiance values in a scene consisting of partiall...

متن کامل

Digital curve compression based on graph theory

The use of an alphabet of line segments to compose a curve is a possible approach for curve data compression. Curves having more sophisticated topology with self-intersections can be handled by methods considering recursive decomposition of the canvas containing the curve. We propose a graph theory based algorithm for tracing the curve directly to eliminate the decomposition needs. This approac...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003